package evaluacredito.modelo;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * The persistent class for the persona database table.
 * 
 */
@Entity
@Table(name = "persona")
@NamedQueries({
		@NamedQuery(name = "Persona.findAll", query = "SELECT us FROM Persona pe"),
		@NamedQuery(name = "Persona.findByIdPersona", query = "SELECT pe FROM Persona pe WHERE pe.idPersona = :idPersona"),
		@NamedQuery(name = "Persona.findByNroDocumento", query = "SELECT pe FROM Persona pe WHERE pe.nroDocumento = :nroDocumento"),
		@NamedQuery(name = "Persona.findByApPaterno", query = "SELECT pe FROM Persona pe WHERE pe.apPaterno = :apPaterno"),
		@NamedQuery(name = "Persona.findByApMaterno", query = "SELECT pe FROM Persona pe WHERE pe.apMaterno = :apMaterno"),
		@NamedQuery(name = "Persona.findByNombres", query = "SELECT pe FROM Persona pe WHERE pe.nombres = :nombres") })
public class Persona implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Basic(optional = false)
	@Column(name = "idPersona")
	private Integer idPersona;
	@Column(name = "nroDocumento")
	private String nroDocumento;
	@Column(name = "apPaterno")
	private String apPaterno;
	@Column(name = "apMaterno")
	private String apMaterno;
	@Column(name = "nombres")
	private String nombres;

	public Persona() {
	}

	public Integer getIdPersona() {
		return idPersona;
	}

	public void setIdPersona(Integer idPersona) {
		this.idPersona = idPersona;
	}

	public String getNroDocumento() {
		return nroDocumento;
	}

	public void setNroDocumento(String nroDocumento) {
		this.nroDocumento = nroDocumento;
	}

	public String getApPaterno() {
		return apPaterno;
	}

	public void setApPaterno(String apPaterno) {
		this.apPaterno = apPaterno;
	}

	public String getApMaterno() {
		return apMaterno;
	}

	public void setApMaterno(String apMaterno) {
		this.apMaterno = apMaterno;
	}

	public String getNombres() {
		return nombres;
	}

	public void setNombres(String nombres) {
		this.nombres = nombres;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (idPersona != null ? idPersona.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof Persona)) {
			return false;
		}
		Persona other = (Persona) object;
		if ((this.idPersona == null && other.idPersona != null)
				|| (this.idPersona != null && !this.idPersona
						.equals(other.idPersona))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "evaluacredito.modelo.Persona[idPersona=" + idPersona + "]";
	}
}